package com.letian.record.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.record.mapper.RecordMusicMapper;
import com.letian.record.domain.RecordMusic;
import com.letian.record.service.IRecordMusicService;

/**
 * 记录歌曲Service业务层处理
 * 
 * @author bmz
 * @date 2023-05-15
 */
@Service
public class RecordMusicServiceImpl implements IRecordMusicService 
{
    @Autowired
    private RecordMusicMapper recordMusicMapper;

    /**
     * 查询记录歌曲
     * 
     * @param musicId 记录歌曲主键
     * @return 记录歌曲
     */
    @Override
    public RecordMusic selectRecordMusicByMusicId(Long musicId)
    {
        return recordMusicMapper.selectRecordMusicByMusicId(musicId);
    }

    /**
     * 查询记录歌曲列表
     * 
     * @param recordMusic 记录歌曲
     * @return 记录歌曲
     */
    @Override
    public List<RecordMusic> selectRecordMusicList(RecordMusic recordMusic)
    {
        return recordMusicMapper.selectRecordMusicList(recordMusic);
    }

    /**
     * 新增记录歌曲
     * 
     * @param recordMusic 记录歌曲
     * @return 结果
     */
    @Override
    public int insertRecordMusic(RecordMusic recordMusic)
    {
        recordMusic.setCreateTime(DateUtils.getNowDate());
        return recordMusicMapper.insertRecordMusic(recordMusic);
    }

    /**
     * 修改记录歌曲
     * 
     * @param recordMusic 记录歌曲
     * @return 结果
     */
    @Override
    public int updateRecordMusic(RecordMusic recordMusic)
    {
        recordMusic.setUpdateTime(DateUtils.getNowDate());
        return recordMusicMapper.updateRecordMusic(recordMusic);
    }

    /**
     * 批量删除记录歌曲
     * 
     * @param musicIds 需要删除的记录歌曲主键
     * @return 结果
     */
    @Override
    public int deleteRecordMusicByMusicIds(Long[] musicIds)
    {
        return recordMusicMapper.deleteRecordMusicByMusicIds(musicIds);
    }

    /**
     * 删除记录歌曲信息
     * 
     * @param musicId 记录歌曲主键
     * @return 结果
     */
    @Override
    public int deleteRecordMusicByMusicId(Long musicId)
    {
        return recordMusicMapper.deleteRecordMusicByMusicId(musicId);
    }
}
